import request from "@/utils/request";
import { ParamsType } from "@/api/corp/project/types";

/**
 * 获取项目管理列表
 */
export function getProjectMagList(data: ParamsType) {
  return request({
    url: "/api/v1/commander/project/project_page",
    method: "get",
    params: data,
  });
}

/**
 * 获取项目管理详情
 */
export function getProjectMagInfo(projectId: number) {
  return request({
    url: `api/v1/commander/project/${projectId}/projectform`,
    method: "get",
  });
}

/**
 * 获取工资单明细详情信息
 */
export function getPayrollDetail(id: number) {
  return request({
    url: "/api/v1/commander/wagepayrolldetail/" + id,
    method: "get",
  });
}

/**
 * 获取工资单审核记录
 */
export function getPayrollInfoAuditLogs(id: number) {
  return request({
    url: "/api/v1/commander/wagepayroll/auditLogs?id=" + id,
    method: "get",
  });
}

/**
 * 获取工资单列表
 */
export function getPayrollList(data: ParamsType) {
  return request({
    url: "/api/v1/commander/wagepayroll/page",
    method: "get",
    params: data,
  });
}

/**
 * 获取专户列表
 */
export function getProjectAccountList(data: ParamsType) {
  return request({
    url: "/api/v1/commander/projectspecialaccount/page",
    method: "get",
    params: data,
  });
}

/**
 * 获取专户信息
 */
export function getProjectAccountInfo(id: number) {
  return request({
    url: `api/v1/commander/projectspecialaccount/${id}/form`,
    method: "get",
  });
}

/**
 * 获取考勤明细列表
 */
export function getAttendanceList(data: ParamsType) {
  return request({
    url: "/api/v1/commander/checkindetail/page",
    method: "get",
    params: data,
  });
}

/**
 * 获取项目班组下拉列表
 */
export function getProjectTeamPulldownList() {
  return request({
    url: "/api/v1/commander/projectgroup/getProjectCorps",
    method: "get",
  });
}

/**
 * 获取项目班组列表
 */
export function getProjectTeamList(data: ParamsType) {
  return request({
    url: "/api/v1/commander/projectgroup/page",
    method: "get",
    params: data,
  });
}

/**
 * 根据班组ID 获取班组人员列表
 */
export function getProjectTeamMemberListByTeamId(id) {
  return request({
    url: "/api/v1/commander/projectgroupmember/getProjectGroupMemberByGroupId/" + id,
    method: "get",
  });
}

/**
 * 获取班组信息
 */
export function getProjectTeamInfo(id: number) {
  return request({
    url: `api/v1/commander/projectgroup/${id}/form`,
    method: "get",
  });
}

/**
 * 获取人员信息
 */
export function getPersonInfo(id: number) {
  return request({
    url: `api/v1/commander/person/${id}/form`,
    method: "get",
  });
}
